Conversation
| @@ -0,0 +1,25 @@ | |||
| export default from './storybook'; | |||
|
|
|||
| // import React from 'react'; | |||
There was a problem hiding this comment.
Is this left here intentionally?
There was a problem hiding this comment.
Yeah, I'll add to the comment tho. 😄
| const StorybookUI = getStorybookUI({ | ||
| port: 7007, | ||
| host: 'localhost', | ||
| // host: 'localhost', |
| }; | ||
|
|
||
| showApp(event) { | ||
| event.preventDefault(); |
There was a problem hiding this comment.
Forgive my ignorance, but why is preventDefault needed?
There was a problem hiding this comment.
It's all over the code (part of the CLI boilerplate), so I propose we address it separately 😕
There was a problem hiding this comment.
You do not typically need to .preventDefault() in React Native. That said I don't see the showApp function used anywhere in this component... so couldn't this method just be removed?
There was a problem hiding this comment.
although - this might be something CRNA related so if so, please ignore my thoughts on removing it.
There was a problem hiding this comment.
OK OK looks like it isn't used so I'll remove across the board, test, and submit. Thanks 🙇
There was a problem hiding this comment.
On third thought, I think this is a separate issue. This used to be used to show off addon-links but was removed at some point. Opened: #1569
Codecov Report
@@ Coverage Diff @@
## master #1568 +/- ##
==========================================
- Coverage 20.43% 20.43% -0.01%
==========================================
Files 241 241
Lines 5250 5252 +2
Branches 656 645 -11
==========================================
Hits 1073 1073
- Misses 3661 3682 +21
+ Partials 516 497 -19
Continue to review full report at Codecov.
|
orta
left a comment
There was a problem hiding this comment.
I ran the same code in our non-CRNA app, and everything was good:
import { NativeModules } from "react-native"
console.log(NativeModules.SourceCode.scriptURL)And got http://localhost:8081/Example/Emission/index.ios.bundle?platform=ios&dev=true&hot=true
So this is fine for non-CRNA too 👍
| if (params.resetStorybook || !channel) { | ||
| const host = params.host || 'localhost'; | ||
|
|
||
| const host = params.host || parse(NativeModules.SourceCode.scriptURL).hostname; |
There was a problem hiding this comment.
Brilliant - didn’t know this was an accessible thing
| const host = params.host || 'localhost'; | ||
|
|
||
| const host = params.host || parse(NativeModules.SourceCode.scriptURL).hostname; | ||
| const port = params.port !== false ? `:${params.port || 7007}` : ''; |
There was a problem hiding this comment.
Is this the port for the ReactNative packager? Or where storybooks web previewed will be binding to?
There was a problem hiding this comment.
this is the storybook port
Issue: #1222
What I did
Use the RN packager's host by default as described in #1222
How to test
First:
Then test RN:
Then test CNRA: